import request from "@/utils/request"

// 获取菜单
export function getMenuList() {
  return request({
    url: "/v1/dataProvider/findChildFunctionTree?funId=CMA",
    method: "get",
  })
}

// 获取单位
export function getCompanyList(params) {
  return request({
    url: "/v1/cmdb/data/query?cmdb!modelNo=met_lp_unit&isQuery=true",
    method: "get",
    params,
  })
}

// 获取单位
export function getCompanyListNew(params) {
  return request({
    url: "/services/biz/lpUnitQuery",
    method: "get",
    params,
  })
}

// 执法人员
export function getLawPersonList(params) {
  return request({
    url: "/v1/cmdb/data/query?cmdb!modelNo=met_legal_person&_dc=1650509619828&cmdb!modelId=10&cmdb!modelNo=met_legal_person",
    method: "get",
    params,
  })
}

// 执法人员
export function getLawPersonListTel() {
  return request({
    url: "/v1/sys/user/query?q_type=1",
    method: "get",
  })
}

// 执法人员2
export function getLawPersonListTelNew() {
  return request({
    url: "/services/biz/findLegalPerson",
    method: "get",
  })
}

export function getLawPerson() {
  return request({
    url: "/v1/dataProvider/getConfigCodeList?codeType=PLUGINS_MET_LEGAL_PERSON",
    method: "get",
  })
}

// 获取检查、带签署、历史列表
export function getCheckCompanyList(params) {
  return request({
    url: "/v1/plugins/met/lpInspectPlanUnit/lpInspectPlanUnitQuery",
    method: "get",
    params,
  })
}

// 获取详情
export function findByPlanDetailId(data) {
  return request({
    url: "/v1/plugins/met/lpInspectPlanUnit/findByPlanDetailId",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  })
}

// 上传pdf
export function uploadPdf(data, inspectId) {
  return request({
    url: `/v1/plugins/met/lpInspect/uploadPdf?inspectId=${ inspectId }`,
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  })
}

// 上传pdf 提交签署2 --- 这个
export function createFlowInspect(data, inspectId) {
  return request({
    url: `/v1/plugins/met/tyesign/createFlowInspect?inspectId=${ inspectId }`,
    method: "post",
    data,
    headers: {
      // "Content-Type": "application/x-www-form-urlencoded",
      "Content-Type": "multipart/form-data",
    },
  })
}

// 发送短信提示
export function smsReminder(data) {
  return request({
    url: `/v1/plugins/met/lpInspectPlanUnit/smsReminder`,
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  })
}

// 绑定视频
export function videoCheck(detailId) {
  return request({
    url: `/v1/plugins/met/lpInspectPlanUnit/videoCheck?detailId=${ detailId }`,
    method: "post",
    // data,
    // headers: {
    //   "Content-Type": "application/x-www-form-urlencoded",
    // },
  })
}
